#ifndef REMOTEEND_H
#define REMOTEEND_H
#include <stdint.h>
#include <windows.h>
#include <string.h>
#include <iostream>

#define CD_INTERVAL_MS 200

using namespace std;

typedef enum RemoteState
{
    ONLINE = 0,
    OFFLINE = 1
} remote_state_t;

DWORD WINAPI countDownEntry(void*);

class RemoteEnd
{
    private:
        char *m_uid_ptr;
        char *m_ip_ptr;
        int32_t m_life;
        int32_t m_life_max;
        remote_state_t m_state;
        HANDLE m_countdown_thread;
        DWORD m_msg_thread_id;
    public:
        RemoteEnd(const char *, const char *, int32_t, DWORD);
        char* getUID(void);
        char* getIP(void);
        int32_t getLife(void);
        void updateIP(const char *);
        DWORD countDown(void);
        void refresh(void);
        ~RemoteEnd();
};

#endif // REMOTEEND_H
